package org.hawk.gwt.ppc.reflect.emul.org.hawk.gwt.ppc.reflect.lang;

import org.hawk.gwt.ppc.reflect.emul.java.lang.reflect.Constructor;
import org.hawk.gwt.ppc.reflect.emul.java.lang.reflect.Field;
import org.hawk.gwt.ppc.reflect.emul.java.lang.reflect.Method;
import org.hawk.gwt.ppc.reflect.lang.ClassDelegate;

import com.google.gwt.core.client.GwtScriptOnly;

/**
 * {@link ReflectAccessor} for the client side of <code>org.hawk.gwt.ppc.reflect</code> module.
 * 
 * @author alex.bereznevatiy@gmail.com
 * 
 */
@GwtScriptOnly
public class ReflectAccessor {

	public <T> Constructor<T> createConstructor(Object accessor, ClassDelegate<T> cls, String signature, boolean varArgs) throws SecurityException {
		return new Constructor<T>(accessor, cls, signature, varArgs);
	}

	public Field createField(Object accessor, ClassDelegate<?> cls, String signature) {
		return new Field(accessor, cls, signature);
	}

	public Method createMethod(Object accessor, ClassDelegate<?> cls, String signature, boolean varArgs) {
		return new Method(accessor, cls, signature, varArgs);
	}

	public Package getPackage(String name) {
		return Package.getPackage(name);
	}
}
